Skip to content

water-elevation-layer#592

Merged
jirhiker merged 1 commit intostagingfrom
water-elevation-layer
Mar 10, 2026
Merged

water-elevation-layer#592
jirhiker merged 1 commit intostagingfrom
water-elevation-layer

Conversation

@jirhiker
Copy link
Copy Markdown
Member

Why

This PR addresses the following problem / context:

  • Use bullet points here

How

Implementation summary - the following was changed / added / removed:

  • Use bullet points here

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Use bullet points here

Copilot AI review requested due to automatic review settings March 10, 2026 06:33
@jirhiker jirhiker merged commit 13f0050 into staging Mar 10, 2026
12 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GitHub Actions CD workflows to refresh the pygeoapi-related materialized views as part of the staging and production deployment process (immediately after running Alembic migrations).

Changes:

  • Add a staging workflow step to run cli.cli refresh-pygeoapi-materialized-views after DB migrations.
  • Add a production workflow step to run cli.cli refresh-pygeoapi-materialized-views after DB migrations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/CD_staging.yml Adds a post-migration step to refresh materialized views against the staging Cloud SQL database.
.github/workflows/CD_production.yml Adds a post-migration step to refresh materialized views against the production Cloud SQL database.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +51 to +56
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env block for the DB connection is now duplicated across multiple steps (migrations + refresh). This increases drift risk if one step’s DB settings change later. Consider moving these shared DB env vars to a job-level env: (or using a YAML anchor) and overriding only what differs per-step.

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +58
- name: Refresh materialized views on production database
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
run: |
uv run python -m cli.cli refresh-pygeoapi-materialized-views
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description is still the unfilled template ("Use bullet points here" under Why/How/Notes). Please update the PR description to describe the problem being solved and what changed so reviewers/operators understand the deployment impact (e.g., when/why the materialized view refresh runs).

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +56
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env block for the DB connection is now duplicated across multiple steps (migrations + refresh). This increases drift risk if one step’s DB settings change later. Consider moving these shared DB env vars to a job-level env: (or using a YAML anchor) and overriding only what differs per-step.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e64d6c8d37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
run: |
uv run python -m cli.cli refresh-pygeoapi-materialized-views
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refresh views concurrently to avoid blocking API reads

In the production deploy workflow, this command invokes refresh-pygeoapi-materialized-views with its default non-concurrent mode (concurrently=False in cli/cli.py), which runs REFRESH MATERIALIZED VIEW and can hold exclusive locks on each materialized view for the duration of the refresh transaction. Because these exact views are the backing tables for live pygeoapi collections (core/pygeoapi-config.yml), requests hitting those endpoints during deployment can block until refresh completes, creating avoidable user-facing downtime; pass --concurrently (supported by the CLI) or otherwise avoid lock-heavy refreshes in the deploy path.

Useful? React with 👍 / 👎.

@TylerAdamMartinez TylerAdamMartinez deleted the water-elevation-layer branch March 12, 2026 17:13
@TylerAdamMartinez TylerAdamMartinez restored the water-elevation-layer branch March 12, 2026 17:13
@TylerAdamMartinez TylerAdamMartinez deleted the water-elevation-layer branch March 12, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants